package controllers

import (
	"Charon/models"
	"github.com/astaxie/beego"
)

// Operations about Charon
type CharonController struct {
	beego.Controller
}

// @Title GetAll
// @Description push to all user
// @Success 200 {string} json "{"status": "0"}"
// @router / [get]
func (u *CharonController) Get() {

	models.Push(u.GetString("msg"))
	u.Data["json"] = map[string]string{"status": "0"}
	u.ServeJSON()
}

// @Title register
// @Description register
// @Param	body		body 	string	true		"the token u want register"
// @Success 200 {string} json "{"status": "0"}"
// @router / [post]
func (u *CharonController) Post() {
	models.Register(string(u.Ctx.Input.RequestBody))

	u.Data["json"] = map[string]string{"status": "0"}
	u.ServeJSON()
}
